<?php
/* 	These code was generated using phpCIGen v 0.1.b (24/06/2009)
	#zaqi 		zaqi.smart@gmail.com,http://zenzaqi.blogspot.com, 
	#CV. Trust Solution, jl. Saronojiwo 19 Surabaya, http://www.ts.co.id
	
	+ Module  		: t_bbmrec Print
	+ Description	: For Print View
	+ Filename 		: p_t_bbmrec.php
 	+ Author  		: 
 	+ Created on 07/Jun/2011 11:52:07
	
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Laporan Penjualan Per Klien</title>
<link rel='stylesheet' type='text/css' href='../assets/modules/main/css/printstyle_nocolor.css'/>
</head>
<body>
<table width="100%" border="0" class="clear">
  <tr class="clear" >
    <td height="38" colspan="4" class="clear"><strong>Laporan Penjualan Per Klien</strong></td>
  </tr>
  <tr class="clear" >
  	<td height="38" colspan="4" class="clear"><strong><?php echo $tgl_start;?> <?php echo $tgl_end;?></strong></td>
  </tr>
</table>
<table width="100%" border="1">
	<thead>
		<tr style="font-weight: bold;">
			<td scope='col'>Klien</td>
			<td scope='col'>Tanggal Order</td>
			<td scope='col'>No. Order</td>
			<td scope='col'>Company</td>
			<td scope='col'>Nilai Order</td>
		</tr>
	</thead>
	<tbody>
		<?php 
		$pump_id = 0;
		$i=0; 
		foreach($data_print as $print) {
			$i++;
			
			if($pump_id!=$print->m_customer_id){
				$order_tot = 0;
				
				foreach($data_print as $print_list) {
					if($print_list->m_customer_id == $print->m_customer_id){
		?>
		<tr>
			<td><?php echo $print->customer_name; ?></td>
			<td><?php echo date('d-m-Y', strtotime($print_list->order_date)); ?></td>
			<td><?php echo $print_list->order_code; ?></td>
			<td><?php echo $print_list->customer_name; ?></td>
			<td align="right"><?php echo number_format($print_list->jumlah, 2, ',', '.'); ?></td>
		</tr>
		<?php 
						$order_tot += $print_list->jumlah;
					}
				}
		?>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td align="right" style="font-weight: bold;"><?php echo number_format($order_tot, 2, ',', '.'); ?></td>
		</tr>
		<?php 
			}
			$pump_id = $print->m_customer_id;
		}
		?>
	</tbody>
</table>
</body>
</html>